package com.gem.back.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gem.back.entity.AoaRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hhhy
 * @since 2020-02-22
 */
@Repository
public interface AoaRoleMapper extends BaseMapper<AoaRole> {
    /**
     * 根据姓名查找角色
     */
    AoaRole findRoleByName(@Param("username") String userName);

    //查询角色关联查询角色菜单
    AoaRole findRoleAndMenu(Integer roleId);

    //根据id删除所有角色菜单
    void deleteRoleMenus(AoaRole sysRole);

    //批量插入角色菜单
    void insertRoleMenus(AoaRole sysRole);



}
